package jsyf.oa.entity.wreport;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author: @张巨波 @zhangjubo
 * @creat: on 2017/11/27.
 * @since: V1.0.0
 * @see jsyf.oa.web
 */

@Entity
@Table(name = "T_WRT_COST", schema = "oa", catalog = "")
public class WReportCostEntity  extends BaseEntity implements Serializable{
    private  String wId;
    private  String costBigName;
    private String costSmallName;
    private  Integer costBigId;
    private Integer costSmallId;
    private String invoiceFlag;
    private String remark;
    private BigDecimal money;
    private Integer start;
    private List<JSONObject> costSmallNameList;
    /**
     * 审核状态:
     * <p>
     * -1:未提交/草稿<br/>
     * 0: 已提交/审核中<br/>
     * 1: 审核通过<br/>
     * 2: 审核驳回<br/>
     * <p>
     */
    private String auditFlag;
    private String reportDate;
    private Date createTime;
    private String createUserId;
    private String createUserName;
    private String currentAuditorId;
    private String currentAuditorName;
    private String copierReturnReason;

    public String getReportDate() {
        return reportDate;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public WReportCostEntity() {
        this.costSmallNameList = new ArrayList<>();
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public String getwId() {
        return wId;
    }

    public void setwId(String wId) {
        this.wId = wId;
    }

    public String getCostBigName() {
        return costBigName;
    }

    public void setCostBigName(String costBigName) {
        this.costBigName = costBigName;
    }

    public void setReportDate(String reportDate) {
        this.reportDate = reportDate;
    }



    public String getCostSmallName() {
        return costSmallName;
    }

    public void setCostSmallName(String costSmallName) {
        this.costSmallName = costSmallName;
    }

    public String getInvoiceFlag() {
        return invoiceFlag;
    }

    public void setInvoiceFlag(String invoiceFlag) {
        this.invoiceFlag = invoiceFlag;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getCostBigId() {
        return costBigId;
    }

    public void setCostBigId(Integer costBigId) {
        this.costBigId = costBigId;
    }

    public Integer getCostSmallId() {
        return costSmallId;
    }

    public void setCostSmallId(Integer costSmallId) {
        this.costSmallId = costSmallId;
    }

    public List<JSONObject> getCostSmallNameList() {
        return costSmallNameList;
    }

    public void setCostSmallNameList(List<JSONObject> costSmallNameList) {
        this.costSmallNameList = costSmallNameList;
    }

    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public String getAuditFlag() {
        return auditFlag;
    }

    public void setAuditFlag(String auditFlag) {
        this.auditFlag = auditFlag;
    }


    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getCurrentAuditorId() {
        return currentAuditorId;
    }

    public void setCurrentAuditorId(String currentAuditorId) {
        this.currentAuditorId = currentAuditorId;
    }

    public String getCurrentAuditorName() {
        return currentAuditorName;
    }

    public void setCurrentAuditorName(String currentAuditorName) {
        this.currentAuditorName = currentAuditorName;
    }

    public String getCopierReturnReason() {
        return copierReturnReason;
    }

    public void setCopierReturnReason(String copierReturnReason) {
        this.copierReturnReason = copierReturnReason;
    }

    @Override
    public JSONObject getJSONObject(){
        JSONObject obj = new JSONObject();
        obj.put("ID",getId());
        obj.put("W_ID",getwId());
        obj.put("COST_BIG_NAME",getCostBigName());
        obj.put("COST_SMALL_NAME",getCostSmallName());
        obj.put("COST_BIG_ID",getCostBigId());
        obj.put("COST_SMALL_ID",getCostSmallId());
        obj.put("MONEY",getMoney());
        obj.put("INVOICE_FLAG",getInvoiceFlag());
        obj.put("REMARK",getRemark());
        obj.put("START",getStart());
        obj.put("AUDIT_FLAG",getAuditFlag());
        obj.put("REPORT_DATE",getReportDate());
        obj.put("CREATE_USER_ID",getCreateUserId());
        obj.put("CREATE_USER_NAME",getCreateUserName());
        obj.put("CURRENT_AUDITOR_ID",getCurrentAuditorId());
        obj.put("CURRENT_AUDITOR_NAME",getCurrentAuditorName());
        obj.put("COPIER_RETURN_REASON",getCopierReturnReason());
        obj.put("CREATE_TIME",getCreateTime());
        return  obj;
    }
    @Override
    public JSONObject getJSONObjectId(){
        JSONObject obj = new JSONObject();
        obj.put("id",getId());
        return  obj;
    }

    @Override
    public String getTableName() {
        return "t_wrt_cost";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("W_ID", "wid");
        obj.put("COST_BIG_NAME", "costBigName");
        obj.put("COST_SMALL_NAME", "costSmallName");
        obj.put("COST_BIG_ID","costBigId");
        obj.put("COST_SMALL_ID","costSmallId");
        obj.put("MONEY","money");
        obj.put("INVOICE_FLAG","invoiceFlag");
        obj.put("REMARK","remark");
        obj.put("START","start");
        obj.put("AUDIT_FLAG","auditFlag");
        obj.put("REPORT_DATE","reportDate");
        obj.put("CREATE_USER_ID","createUserId");
        obj.put("CREATE_USER_NAME","createUserName");
        obj.put("CURRENT_AUDITOR_ID","currentAuditorId");
        obj.put("CURRENT_AUDITOR_NAME","currentAuditorName");
        obj.put("COPIER_RETURN_REASON", "copierReturnReason");
        obj.put( "CREATE_TIME", "createTime");
        return obj;
    }

    @Override
    public String getViewName() {
        return "V_WRT_COST";
    }
}
